﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Xml;
using System.Xml.XPath;
using System.IO;

namespace AppEntity
{    
    /// <summary>
    /// C# Int 基础类库扩展
    /// </summary>   
    public static class IntExtension
    {
        /// <summary>
        /// 循环执行 N 次委托，并传入当前次数，直至委托返回 false。
        /// </summary>
        /// <param name="N"></param>
        /// <param name="Method"></param>
        public static void For(this int N, Func<int, bool> Method)
        {
            for (int i = 0; i < N; i++)
            {
                if (!Method(i)) break;
            }
        }
    }
    
}
